home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 13 / IconEdit.r next >
Encoding:
Text File  |  1990-10-25  |  5.4 KB  |  193 lines  |  [TEXT/MPS ]

  1. /*********************************************************************************/
  2. /* IconEdit.r                                                                     */
  3. /*                                                                                 */
  4. /* Copyright © 1989 Apple Computer, Inc.  All rights reserved.                       */
  5. /*                                                                                  */
  6. /*********************************************************************************/
  7.  
  8. /* ==============================   Includes   ================================= */
  9.  
  10. #ifndef _TYPES.R_
  11. #include "Types.r"
  12. #endif
  13.  
  14. #ifndef _MacAppTypes_
  15. #include "MacAppTypes.r"
  16. #endif
  17.  
  18. #ifndef __ViewTypes__
  19. #include "ViewTypes.r"
  20. #endif
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25. include "MacApp.rsrc";
  26.  
  27. include "IconEdit" 'CODE';
  28.  
  29.  
  30. /* ==============================   Constants   ================================ */
  31.  
  32. #define cZoomIn                1000
  33. #define cZoomOut            1001
  34. #define cInvert                1002
  35.  
  36. #define kSeedIconId            1000
  37.  
  38. #define kIconWindowId        1000
  39.  
  40. #define kIconWindowId        1000
  41. #define kIconViewId            1001
  42.  
  43. #define kIconViewHeight        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  44. #define kIconViewWidth        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  45.  
  46. #define kIconWindowHeight    kIconViewHeight + kSBarSizeMinus1
  47. #define kIconWindowWidth    kIconViewWidth + kSBarSizeMinus1
  48.  
  49.  
  50.  
  51. /* ==============================   Seed Icon   ================================ */
  52.  
  53. resource 'ICON' (kSeedIconId, purgeable) {
  54.     $"0001 0000 0002 8000 0004 4000 0008 2000 0010 1000 0020 0800 0040 0400 0080 0200"
  55.     $"0100 0100 0200 0080 0400 0040 0800 0020 1000 0010 2000 0008 4000 3F04 8000 4082"
  56.     $"4000 8041 2001 3022 1001 C814 080E 7F8F 0402 3007 0201 0007 0100 8007 0080 6007"
  57.     $"0040 1FE7 0020 021F 0010 0407 0008 0800 0004 1000 0002 2000 0001 4000 0000 8000"
  58. };
  59.  
  60.  
  61.  
  62.  
  63. /* =============================   Icon Window   =============================== */
  64.  
  65. resource 'view' (kIconWindowId, purgeable) {
  66.     {
  67.         root, 'WIND', { 50, 20 }, { kIconWindowHeight, kIconWindowWidth },
  68.         sizeVariable, sizeVariable, shown, enabled,
  69.         Window        { "", zoomDocProc, goAwayBox, resizable, modeless,
  70.                           ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  71.                           openWithDocument, dontAdaptToScreen, stagger, forceOnScreen,
  72.                           dontCenter, 'ICON', "" };
  73.                     
  74.         'WIND',  'SCLR',    { 0, 0 },
  75.         { kIconWindowHeight-kSBarSizeMinus1, kIconWindowWidth-kSBarSizeMinus1 },
  76.         sizeRelSuperView, sizeRelSuperView, shown, enabled,
  77.         Scroller    { "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  78.                           vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  79.  
  80.         'SCLR', IncludeViews    { kIconViewId }
  81.     }
  82. };
  83.  
  84. resource 'view' (kIconViewId, purgeable) {
  85.     {
  86.         root, 'ICON', { 0, 0 }, { kIconViewHeight, kIconViewWidth },
  87.         sizeVariable, sizeVariable, shown, enabled,
  88.         View        { "TIconView"}
  89.     }
  90. };
  91.  
  92.  
  93. /* NOTE: if you used ViewEdit, then replace the above 'view' resources with:     */
  94. /* include "Views.rsrc" 'view';                                                  */
  95.  
  96.  
  97.  
  98. /* ================================   Menus   ================================== */
  99.  
  100. resource 'cmnu' (mApple) {
  101.     1,
  102.     textMenuProc,
  103.     0x7FFFFFFD,
  104.     enabled,
  105.     apple,
  106.      {
  107.     /* [1] */    "About IconEdit…",    noIcon,    noKey,    noMark,    plain,    cAboutApp;
  108.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand
  109.     }
  110. };
  111.  
  112.  
  113. /* ------------------------------------------------------------------------------ */
  114.  
  115. resource 'cmnu' (mFile) {
  116.     2,
  117.     textMenuProc,
  118.     allEnabled,
  119.     enabled,
  120.     "File",
  121.      {
  122.     /* [1] */    "New",                noIcon,    "N",    noMark,    plain,    cNew;
  123.     /* [2] */    "Open…",            noIcon,    "O",    noMark,    plain,    cOpen;
  124.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  125.     /* [4] */    "Close",            noIcon,    noKey,    noMark,    plain,    cClose;
  126.     /* [5] */    "Save",                noIcon,    noKey,    noMark,    plain,    cSave;
  127.     /* [6] */    "Save As…",            noIcon,    noKey,    noMark,    plain,    cSaveAs;
  128.     /* [7] */    "Revert to Saved",    noIcon,    noKey,    noMark,    plain,    cRevert;
  129.     /* [8] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  130.     /* [9] */    "Page Setup…",        noIcon,    noKey,    noMark,    plain,    cPageSetup;
  131.     /* [10] */    "Print…",            noIcon,    noKey,    noMark,    plain,    cPrint;
  132.     /* [11] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  133.     /* [12] */    "Quit",                noIcon,    "Q",    noMark,    plain,    cQuit
  134.     }
  135. };
  136.  
  137.  
  138. /* ------------------------------------------------------------------------------ */
  139.  
  140. resource 'cmnu' (mEdit) {
  141.     3,
  142.     textMenuProc,
  143.     allEnabled,
  144.     enabled,
  145.     "Edit",
  146.      {
  147.     /* [1] */    "Undo",                noIcon,    "Z",    noMark,    plain,    cUndo;
  148.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  149.     /* [3] */    "Cut",                noIcon,    "X",    noMark,    plain,    cCut;
  150.     /* [4] */    "Copy",                noIcon,    "C",    noMark,    plain,    cCopy;
  151.     /* [5] */    "Paste",            noIcon,    "V",    noMark,    plain,    cPaste;
  152.     /* [6] */    "Clear",            noIcon,    noKey,    noMark,    plain,    cClear;
  153.     /* [7] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  154.     /* [8] */    "Show Clipboard",    noIcon,    noKey,    noMark,    plain,    cShowClipboard
  155.     }
  156. };
  157.  
  158.  
  159. /* ------------------------------------------------------------------------------ */
  160.  
  161. resource 'cmnu' (4) {
  162.     4,
  163.     textMenuProc,
  164.     allEnabled,
  165.     enabled,
  166.     "Icon",
  167.      {
  168.     /* [1] */    "Zoom In",             noIcon, "M",    noMark, plain,    cZoomIn;
  169.     /* [2] */    "Zoom Out",         noIcon, "L",     noMark, plain,    cZoomOut;
  170.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  171.     /* [4] */    "Invert",             noIcon, "I",     noMark, plain,    cInvert
  172.     }
  173. };
  174.  
  175.  
  176. /* ------------------------------------------------------------------------------ */
  177.  
  178. resource 'cmnu' (mBuzzWords) {
  179.     mBuzzWords,
  180.     textMenuProc,
  181.     allEnabled,
  182.     enabled,
  183.     "Buzzwords",
  184.      {
  185.     /* [1] */    "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle
  186.     }
  187. };
  188.  
  189.  
  190. /* ------------------------------------------------------------------------------ */
  191.  
  192. resource 'MBAR' (128) { {mApple; mFile; mEdit; 4} };
  193.